home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2002 January / maximum-cd-2002-01.iso / Files / Mechwarrior 4 Mapping / MW4Editor.exe / content / ABLScripts / Bots / UberBot.abl < prev    next >
Encoding:
Text File  |  2001-07-16  |  2.8 KB  |  110 lines

  1.  
  2. fsm UberBot : integer;
  3.  
  4.  
  5. //------------------------------------------------------------------
  6.  
  7. // UberBot:
  8. //   Intended to display the maximum amount of challenge that the game can provide.
  9.  
  10. //------------------------------------------------------------------
  11.  
  12.  
  13. //------------------------------------------------------------------
  14. //     Constants
  15. //------------------------------------------------------------------
  16.  
  17.     const
  18.         #include_ <content\ABLScripts\mwconst.abi>
  19.  
  20. //------------------------------------------------------------------
  21. //     Types
  22. //------------------------------------------------------------------
  23.  
  24.     type
  25.         #include_ <content\ABLScripts\mwtype.abi>
  26.     
  27.  
  28. //------------------------------------------------------------------
  29. //     Variables
  30. //------------------------------------------------------------------
  31.  
  32.     var
  33.         static integer            attackRange;        // At what range do I start shooting?
  34.         static integer            withdrawRange;        // At what range do I withdraw?
  35.                                                                     
  36. //------------------------------------------------------------------
  37. //     Init: my initialization function
  38. //------------------------------------------------------------------
  39.  
  40. function Init;
  41.     code
  42.         // script-specific variables
  43.         attackRange        = 9999;
  44.         withdrawRange    = 9999;
  45.  
  46.         // driver settings
  47.         SetFiringDelay            (ME,0.0,0.0);
  48.         SetIgnoreFriendlyFire    (ME,true);
  49.         SetIsShotRadius            (ME,200);
  50.         SetEntropyMood            (ME,AGRESSIVE_END);
  51.         SetCurMood                (ME,AGRESSIVE_END);
  52.         SetSkillLevel            (ME,100,999,100);
  53.         SetAttackThrottle        (ME,100);
  54.         SetMinSpeed                (ME,100);
  55.  
  56.         EnablePerWeaponRayCasting    (ME,TRUE);
  57.  
  58. endfunction;
  59.  
  60. //------------------------------------------------------------------
  61. //    StartState: my initial state
  62. //------------------------------------------------------------------
  63.  
  64. state StartState;
  65.  
  66.     code
  67.         trans WaitToAmbushState;
  68.  
  69. endstate;
  70.  
  71. //------------------------------------------------------------------
  72. //    WaitInAmbushState: wait for someone to come close enough to attack
  73. //------------------------------------------------------------------
  74.  
  75. state WaitToAmbushState;
  76.     code
  77.         if (Bot_FindEnemy(attackrange)) then
  78.             trans AttackState;
  79.         endif;
  80.  
  81.         OrderMoveLookOut;
  82. endstate;
  83.  
  84. //------------------------------------------------------------------
  85. //    AttackState: the ambush is over -- let's kick some ass!
  86. //------------------------------------------------------------------
  87.  
  88. state AttackState;
  89.     code
  90.         if (LeaveAttackState(withdrawRange)) then
  91.             trans WaitToAmbushState;
  92.         endif;
  93.  
  94.         OrderAttackTactic(TACTIC_FAST_CIRCLE,TRUE);
  95. endstate;
  96.  
  97. //------------------------------------------------------------------
  98. //    DeadState: OK, I kicked the bucket.
  99. //------------------------------------------------------------------
  100.  
  101. state DeadState;
  102.     code
  103.         orderDie;
  104.  
  105. endstate;
  106.  
  107.  
  108. endfsm.
  109.  
  110.